package la.iok.hzsvn.lewin.movie.cloud.entity;

import la.iok.hzsvn.lewin.movie.core.model.OrgUnitType;
import la.iok.hzsvn.lewin.movie.core.model.SimpleOrgUnitVo;
import la.iok.hzsvn.share.collection.IdAble;
import java.util.Date;

/**
 * 组织,指店铺或者公司
 */
public class OrgUnit implements IdAble<Long> {
    /**
     * 唯一标识
     */
    private Long id;
    /**
     * 类型,1：店铺；2：加盟商；3：部门
     */
    private int type;
    /**
     * 名称
     */
    private String name;
    /**
     * 创建组织的用户id
     */
    private Long createUserId;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 父组织id
     */
    private Long parentId;
    /**
     * 状态位。0表示正常状态,1表示已经下线
     */
    private Integer status;
    /**
     * PAD端是否隐藏云端剧本列表，1：隐藏，0:不隐藏。默认为0
     */
    private Integer hideCloudMovie;

    @Override
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getHideCloudMovie() {
        return hideCloudMovie;
    }

    public void setHideCloudMovie(Integer hideCloudMovie) {
        this.hideCloudMovie = hideCloudMovie;
    }

    /**
     * 判断是否正常状态
     * @return 正常状态返回true,否则false
     */
    public boolean statusNormal(){
        return status != null && status == SimpleOrgUnitVo.STATUS_NORMAL;
    }
    /**
     * 是否加盟商类型
     * @return 是返回true,否则false
     */
    public boolean franchisee(){
        return type == OrgUnitType.FRANCHISEE.getCode();
    }

    /**
     * 判断是否店铺类型
     * @return 是返回true,否则false
     */
    public boolean shop(){
        return type == OrgUnitType.SHOP.getCode();
    }
}
